library(readr)
library(ggplot2)

#plotting figure 1

figure1_data <- read_csv("/Users/cheng/OneDrive/Desktop/character/character/2_proportion_analysis/Figure1Data.csv")

bodyProp <- ggplot(figure1_data, aes(x=pub_date, y = percentage, color=gender))+
  geom_point(aes(shape = gender))+
  geom_smooth()+
  labs(title = "Percentage of Characterization that is Bodily Description")+
  scale_y_continuous(breaks = seq(0, 20, by = 5), labels = function(x) paste0(x, "%")) +
  scale_x_continuous(breaks = seq(1850, 2000, by = 50))+
  theme(axis.title.x=element_blank(),
        axis.title.y=element_blank())
bodyProp

#plotting figure 2 & 3

figure2_data <- read_csv("/Users/cheng/OneDrive/Desktop/character/character/2_proportion_analysis/Figure2Data.csv")

fProp <- ggplot(figure2_data, aes(x=pub_date, y = percentage, color=gender))+
  geom_point(aes(shape = gender))+
  geom_smooth()+
  labs(title = "Percentage of Bodily Description in Books by Women")+
  scale_y_continuous(breaks = seq(0, 20, by = 5), labels = function(x) paste0(x, "%")) +
  scale_x_continuous(breaks = seq(1850, 2000, by = 50))+
  theme(axis.title.x=element_blank(),
        axis.title.y=element_blank())
fProp

figure3_data <- read_csv("/Users/cheng/OneDrive/Desktop/character/character/2_proportion_analysis/Figure3Data.csv")
mProp <- ggplot(figure3_data, aes(x=pub_date, y = percentage, color=gender))+
  geom_point(aes(shape = gender))+
  geom_smooth()+
  labs(title = "Percentage of Bodily Description in Books by Men")+
  scale_y_continuous(breaks = seq(0, 20, by = 5), labels = function(x) paste0(x, "%")) +
  scale_x_continuous(breaks = seq(1850, 2000, by = 50))+
  theme(axis.title.x=element_blank(),
        axis.title.y=element_blank())
mProp